//
//  UserIdValidator.m
//  liangyi
//
//  Created by 张水 on 16/12/19.
//  Copyright © 2016年 yswh. All rights reserved.
//

#import "UserIdValidator.h"

@implementation UserIdValidator


- (BOOL)validateInput:(UITextField *)input{
    
    if (![CommonMethod checkUserInput:input.text]) {
        self.errorMessage = @"用户ID不能为空";
    }else if (![CommonMethod checkNumbersWithRegex:input.text]) {
        self.errorMessage = @"用户ID格式错误";
    }else {
        self.errorMessage = nil;
    }
    
    return self.errorMessage == nil ? YES : NO;
}

@end
